<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateLogImports  extends \App\Utils\CreateMigration
{
    function columns(Blueprint $table)
    {
        $table->unsignedTinyInteger('type')->default(0)->comment('导入类型');
        $table->unsignedInteger('total')->default(0)->comment('总条数');
        $table->unsignedInteger('success')->default(0)->comment('成功条数');
        $table->unsignedInteger('error')->default(0)->comment('异常条数');
        $table->timestamp('import_time')->nullable()->comment('导入时间');
        $table->unsignedBigInteger('user_id')->default(0)->comment('创建人');
        $table->string('file_name')->default('')->comment('文件名称');
        $table->string('import_path')->default('')->comment('导入文件地址');
        $table->string('error_path')->default('')->comment('异常文件地址');
        $table->index(['type'], 'idx_type');
    }

    function tableInfo()
    {
        return ['log__imports', '日志-导入'];
    }
}
